<?php
/**
 * Alternate.php
 * 
 * @category    Madoqua
 * @package     View
 * @subpackage  Helper
 */

/** base class */
require_once 'Madoqua/View/Helper/Abstract.php';

/**
 * Madoqua_View_Helper_Alternate
 * 
 * @category    Madoqua
 * @package     View
 * @subpackage  Helper
 */
class Madoqua_View_Helper_Alternate extends Madoqua_View_Helper_Abstract {

    /**
     * position
     *
     * @var int
     */
    private $_position = 0;
    
    /**
     * alternate between values
     *
     * @param $values
     */
    public function alternate($values) {
        return $values[$this->_position++ % count($values)];
    }
}